package org.xx.armory.swing.builders;

import java.util.ArrayList;
import java.util.List;

public class TableModelBuilder
        extends ComponentModelBuilder<TableModel> {
    private int rowSize;
    private List<TableColumnModel> columns;

    public TableModelBuilder() {
        this.columns = new ArrayList<>();
    }

    public TableModelBuilder setRowSize(
            int rowSize
    ) {
        this.rowSize = rowSize;
        return this;
    }

    public void addColumn(
            TableColumnModel column
    ) {
        this.columns.add(column);
    }

    @Override
    public TableModel build() {
        return new TableModel(getLineInfo(), getName(), isVisible(), this.rowSize, this.columns);
    }
}
